home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wantan1a / frmmain.frm (.txt) < prev    next >
Visual Basic Form  |  1999-09-05  |  10KB  |  279 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMain 
  3.    BackColor       =   &H80000005&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "macro font converter"
  6.    ClientHeight    =   2685
  7.    ClientLeft      =   0
  8.    ClientTop       =   0
  9.    ClientWidth     =   3540
  10.    BeginProperty Font 
  11.       Name            =   "Arial"
  12.       Size            =   8.25
  13.       Charset         =   0
  14.       Weight          =   400
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "frmMain.frx":0000
  20.    LinkTopic       =   "Form1"
  21.    ScaleHeight     =   2685
  22.    ScaleWidth      =   3540
  23.    ShowInTaskbar   =   0   'False
  24.    StartUpPosition =   2  'CenterScreen
  25.    Begin VB.Frame Frame1 
  26.       BackColor       =   &H80000012&
  27.       Height          =   3255
  28.       Left            =   -240
  29.       TabIndex        =   0
  30.       Top             =   -360
  31.       Width           =   3855
  32.       Begin VB.CommandButton cmdConvert 
  33.          BackColor       =   &H8000000E&
  34.          Caption         =   "convert"
  35.          BeginProperty Font 
  36.             Name            =   "Arial"
  37.             Size            =   8.25
  38.             Charset         =   0
  39.             Weight          =   700
  40.             Underline       =   0   'False
  41.             Italic          =   0   'False
  42.             Strikethrough   =   0   'False
  43.          EndProperty
  44.          Height          =   330
  45.          Left            =   2640
  46.          Style           =   1  'Graphical
  47.          TabIndex        =   9
  48.          Top             =   2520
  49.          Width           =   975
  50.       End
  51.       Begin VB.ComboBox cmbFonts 
  52.          BackColor       =   &H80000009&
  53.          ForeColor       =   &H8000000E&
  54.          Height          =   330
  55.          Left            =   360
  56.          Sorted          =   -1  'True
  57.          TabIndex        =   8
  58.          Text            =   "arial"
  59.          Top             =   2520
  60.          Width           =   2175
  61.       End
  62.       Begin VB.VScrollBar vsbFontSize 
  63.          Height          =   255
  64.          Left            =   840
  65.          Max             =   4
  66.          Min             =   140
  67.          TabIndex        =   6
  68.          Top             =   2160
  69.          Value           =   20
  70.          Width           =   375
  71.       End
  72.       Begin VB.CheckBox chkItalic 
  73.          BackColor       =   &H00000000&
  74.          Caption         =   "italic"
  75.          ForeColor       =   &H8000000E&
  76.          Height          =   210
  77.          Left            =   360
  78.          TabIndex        =   5
  79.          Top             =   1680
  80.          Width           =   615
  81.       End
  82.       Begin VB.CheckBox chkBold 
  83.          BackColor       =   &H00000000&
  84.          Caption         =   "bold"
  85.          ForeColor       =   &H8000000E&
  86.          Height          =   210
  87.          Left            =   360
  88.          TabIndex        =   4
  89.          Top             =   1440
  90.          Width           =   615
  91.       End
  92.       Begin VB.CheckBox chkUnderline 
  93.          BackColor       =   &H00000000&
  94.          Caption         =   "underline"
  95.          ForeColor       =   &H8000000E&
  96.          Height          =   210
  97.          Left            =   360
  98.          TabIndex        =   3
  99.          Top             =   1920
  100.          Width           =   975
  101.       End
  102.       Begin VB.PictureBox picMacro 
  103.          AutoRedraw      =   -1  'True
  104.          BackColor       =   &H00000000&
  105.          BeginProperty Font 
  106.             Name            =   "Arial"
  107.             Size            =   20.25
  108.             Charset         =   0
  109.             Weight          =   400
  110.             Underline       =   0   'False
  111.             Italic          =   0   'False
  112.             Strikethrough   =   0   'False
  113.          EndProperty
  114.          ForeColor       =   &H8000000E&
  115.          Height          =   855
  116.          Left            =   360
  117.          ScaleHeight     =   53
  118.          ScaleMode       =   3  'Pixel
  119.          ScaleWidth      =   213
  120.          TabIndex        =   2
  121.          Top             =   480
  122.          Width           =   3255
  123.       End
  124.       Begin VB.TextBox txtText 
  125.          BeginProperty Font 
  126.             Name            =   "Arial"
  127.             Size            =   20.25
  128.             Charset         =   0
  129.             Weight          =   400
  130.             Underline       =   0   'False
  131.             Italic          =   0   'False
  132.             Strikethrough   =   0   'False
  133.          EndProperty
  134.          ForeColor       =   &H00000000&
  135.          Height          =   1125
  136.          Left            =   1440
  137.          MultiLine       =   -1  'True
  138.          ScrollBars      =   3  'Both
  139.          TabIndex        =   1
  140.          Top             =   1320
  141.          Width           =   2175
  142.       End
  143.       Begin VB.Label lblFontSize 
  144.          Alignment       =   2  'Center
  145.          BackColor       =   &H00000000&
  146.          BorderStyle     =   1  'Fixed Single
  147.          Caption         =   "20"
  148.          ForeColor       =   &H8000000E&
  149.          Height          =   255
  150.          Left            =   360
  151.          TabIndex        =   7
  152.          Top             =   2160
  153.          Width           =   375
  154.       End
  155.    End
  156. Attribute VB_Name = "frmMain"
  157. Attribute VB_GlobalNameSpace = False
  158. Attribute VB_Creatable = False
  159. Attribute VB_PredeclaredId = True
  160. Attribute VB_Exposed = False
  161. Option Explicit
  162. '5.1.99 - after several requests for this, i decided that even though
  163. 'i felt something like this wasn't worth while, i decided to go ahead
  164. 'and do it anyway. honestly something like this is a novelty, but like
  165. 'i said, you guys wanted this. i guess its kind of cool. well it was
  166. 'for about 5 or 10 min anyway. honestly, i thought it would've been
  167. 'a little harder. oh well. either way, enjoy. if you have any questions
  168. 'or comments, feel free to contact me.
  169. 'dos@hider.com
  170. 'www.hider.com/dos
  171. Private lngFontSize As Long
  172. Private Sub chkBold_Click()
  173.     'in this sub we're checking to see if the bold checkbox is
  174.     'checked or unchecked. we will change the fontbold properties
  175.     'of our textbox and picturebox as well as redraw our text to
  176.     'the picturebox.
  177.     If chkBold.Value = vbChecked Then
  178.         txtText.FontBold = True
  179.         picMacro.FontBold = True
  180.     Else
  181.         txtText.FontBold = False
  182.         picMacro.FontBold = False
  183.     End If
  184.     Call TextToPictureBox(txtText, picMacro)
  185. End Sub
  186. Private Sub chkItalic_Click()
  187.     'this is the same as the bold checkbox. this time we're setting
  188.     'the italic properties.
  189.     If chkItalic.Value = vbChecked Then
  190.         txtText.FontItalic = True
  191.         picMacro.FontItalic = True
  192.     Else
  193.         txtText.FontItalic = False
  194.         picMacro.FontItalic = False
  195.     End If
  196.     Call TextToPictureBox(txtText, picMacro)
  197. End Sub
  198. Private Sub chkUnderline_Click()
  199.     'again, like the bold and italic checkboxes, we're setting another
  200.     'font property, this time the undline property.
  201.     If chkUnderline.Value = vbChecked Then
  202.         txtText.FontUnderline = True
  203.         picMacro.FontUnderline = True
  204.     Else
  205.         txtText.FontUnderline = False
  206.         picMacro.FontUnderline = False
  207.     End If
  208.     Call TextToPictureBox(txtText, picMacro)
  209. End Sub
  210. Private Sub cmbFonts_Click()
  211.     'in this sub, we're responding to the change of the font name
  212.     'in our combobox. a lot of this code looks unecessary, but it
  213.     'isn't. when different fonts are loaded, they may have a different
  214.     'size, be bolded, italic, etc. we must account for this and
  215.     'adjust our controls accordingly.
  216.     txtText.FontName = cmbFonts.Text
  217.     picMacro.FontName = cmbFonts.Text
  218.     vsbFontSize.Value = txtText.FontSize
  219.     lblFontSize.Caption = vsbFontSize.Value
  220.     If txtText.FontBold = True Then
  221.         chkBold.Value = vbChecked
  222.     Else
  223.         chkBold.Value = vbUnchecked
  224.     End If
  225.     If txtText.FontItalic = True Then
  226.         chkItalic.Value = vbChecked
  227.     Else
  228.         chkItalic.Value = vbUnchecked
  229.     End If
  230.     If txtText.FontUnderline = True Then
  231.         chkUnderline.Value = vbChecked
  232.     Else
  233.         chkUnderline.Value = vbUnchecked
  234.     End If
  235.     Call TextToPictureBox(txtText, picMacro)
  236. End Sub
  237. Private Sub cmdConvert_Click()
  238.     'in this button's event, we're calling to our convert function
  239.     'which converts the picture box to our ascii art